package com.ruoyi.sl.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.sl.domain.SlModule;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sl.mapper.SlColourMapper;
import com.ruoyi.sl.domain.SlColour;
import com.ruoyi.sl.service.ISlColourService;

/**
 * 颜色Service业务层处理
 * 
 * @author admin
 * @date 2024-06-03
 */
@Service
public class SlColourServiceImpl implements ISlColourService 
{
    @Autowired
    private SlColourMapper slColourMapper;

    /**
     * 查询颜色
     * 
     * @param colourId 颜色主键
     * @return 颜色
     */
    @Override
    public SlColour selectSlColourByColourId(Long colourId)
    {
        return slColourMapper.selectSlColourByColourId(colourId);
    }

    /**
     * 查询颜色列表
     * 
     * @param slColour 颜色
     * @return 颜色
     */
    @Override
    public List<SlColour> selectSlColourList(SlColour slColour)
    {
        return slColourMapper.selectSlColourList(slColour);
    }


    /**
     * 查询所有颜色
     *
     * @return 颜色集合
     */
    @Override
    public List<SlColour> selectColourAll(){
        return slColourMapper.selectColourAll();
    }

    /**
     * 新增颜色
     * 
     * @param slColour 颜色
     * @return 结果
     */
    @Override
    public int insertSlColour(SlColour slColour)
    {
        slColour.setCreateTime(DateUtils.getNowDate());
        return slColourMapper.insertSlColour(slColour);
    }

    /**
     * 修改颜色
     * 
     * @param slColour 颜色
     * @return 结果
     */
    @Override
    public int updateSlColour(SlColour slColour)
    {
        slColour.setUpdateTime(DateUtils.getNowDate());
        return slColourMapper.updateSlColour(slColour);
    }

    /**
     * 批量删除颜色
     * 
     * @param colourIds 需要删除的颜色主键
     * @return 结果
     */
    @Override
    public int deleteSlColourByColourIds(Long[] colourIds)
    {
        return slColourMapper.deleteSlColourByColourIds(colourIds);
    }

    /**
     * 删除颜色信息
     * 
     * @param colourId 颜色主键
     * @return 结果
     */
    @Override
    public int deleteSlColourByColourId(Long colourId)
    {
        return slColourMapper.deleteSlColourByColourId(colourId);
    }
}
